package com.nb.pojo;

import org.springframework.stereotype.Component;
/*
* @Component创建对象，等同于bean的功能
* value：就是对象的名称，也就是bean的id值，value的值是唯一值，创建的对象在整个spring容器中就一个
* */
@Component(value="people1")
public class People {
    private String name;
    private int age;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "People{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
